#include "ParamSys.h"
#include "math.h"

void WL_LINK_PWR_Encoder(void* val_def, void* sys_result)
{
	double tmp = *((double *)val_def);
	double final = pow(10, (tmp / 10));
	*((double *)sys_result) = final;
}
void WL_LINK_PWR_Decoder(void* val_sys, void* def_result)
{
	double tmp = (double)(*((double*)val_sys));
	double InDB = 10 * log10(tmp);
	double final = (double)((int)(InDB * 2)); final = (final / 2);
	*((double *)def_result) = final;
}

const ParameterSystem System_WL_LINK_PWR[System_WL_LINK_PWR_COUNT] = {
		{"DBM", 0, 0},
		{"MW", WL_LINK_PWR_Encoder, WL_LINK_PWR_Decoder},
};

